#!/usr/bin/env node
const http=require('http'),
      log=console.log;
let html=`<!DOCTYPE html>
  <html lang="en">
  <head>
    <meta charset="UTF-8">
    <title> </title>
  </head>
  <body>
    <form action="POST">
      <label>username</label>
      <input type="text">
      <br>
      <label>password</label>
      <input type="text">
      <br>
      <label>username</label>
      <input type="text">
      <br>
    </form>  
  </body>
</html>`;
http.createServer((req,res)=>{
  if(req.url!='/'){
    res.statusCode=404;
    res.setHeader('conten-type','text/html');
    res.end('<h1>Not Found</h1>');
    return;
  }
  res.writeHead(200,{
    'content-type':'text/html',
    'content-length':Buffer.byteLength(html)
  });
  //res.statusCode=200;
  //res.setHeader('Content-Type','text/html');
  //res.setHeader('Content-Length',Buffer.byteLength(html));

  //header, txt/html

  res.end(html);
}).listen(8080);
